<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Page
 *
 * @author nofear
 */

namespace Shared\Main;

use Doctrine\ORM\Mapping as ORM;
use Shared\LRC\Annotations as LRC;
use Shared\EventListener\AuditableInterface;
use Shared\LRC\Entity\TranslatableI;
use Shared\Main\ReadableCaptionInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="pages")
 * @LRC\Entity
 */
class Page extends SiteObject implements TranslatableI {

    /**
     * @LRC\Column
     */
    private $title;

    /**
     * @LRC\Column
     */
    private $content;
    
    /**
     * @LRC\Column
     */
    private $slug;
    
    /**
     * @ORM\Column(name="`key`")
     */
    private $key;

    /**
     * @ORM\OneToOne(targetEntity="Metadata")
     * @ORM\JoinColumn(name="metadataId", referencedColumnName="id")
     */
    private $MetaData;

    /**
     * @ORM\Column(name="`order`")
     */
    private $order;
    
    /**
     * 
     * @ORM\OneToMany(targetEntity="Shared\Main\LRC\Page", mappedBy="Object")
     * @LRC\Translation
     */
    protected $translations;

    public function __construct() {
        $this->translations = new \Doctrine\Common\Collections\ArrayCollection;
    }

    public function getTitle() {
        return $this->title;
    }

    public function setTitle($title) {
        $this->title = $title;
    }

    public function getContent() {
        return $this->content;
    }

    public function setContent($content) {
        $this->content = $content;
    }

    public function getKey() {
        return $this->key;
    }

    public function setKey($key) {
        $this->key = $key;
    }

    public function getMetaData() {
        return $this->MetaData;
    }

    public function setMetaData($MetaData) {
        $this->MetaData = $MetaData;
    }
    
    public function getTranslations() {
        return $this->translations;
    }

    public function setTranslations($translations) {
        $this->translations = $translations;
    }
    
    public function getOrder() {
        return $this->order;
    }

    public function setOrder($order) {
        $this->order = $order;
    }
    
    public function getSlug() {
        return $this->slug;
    }

    public function setSlug($slug) {
        $this->slug = $slug;
    }
}
